package com.itheima.boject;

import java.util.Scanner;

public class StringDemo2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入:");
        String s = sc.next();
        //将字符拆解成字符数组
        //char[] toCharArray( )获取字符串对应的字符数组
        char[] chars = s.toCharArray();
        //循环遍历
        for (int i = 0; i < chars.length; i++) {
            System.out.println(chars[i]);
        }
    }
}
